<link rel="stylesheet" type="text/css" href="/assets/css/tableform.css">
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">仓库:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-warehouse_id" data-rule="required" data-source="information/warehouse/index" class="form-control selectpage" name="row[warehouse_id]" type="text" value="{$row.warehouse_id|htmlentities}">
        </div>
        <label class="control-label col-xs-12 col-sm-2">日期:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-code_date" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[code_date]" type="text" value="{$row.code_date}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">单号:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-code"  readonly class="form-control" name="row[code]" type="text" value="{$row.code}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">选择物料:</label>
        <a href="javascript:;"  id="choose-goods" style="margin-left: 15px;"  class="col-sm-1 btn btn-success" title="打开选择" ><i class="fa fa-plus"></i> 选择</a>
    </div>

<!--    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"width="100%"></table>-->
    <div style="white-space: nowrap;overflow-x: auto;width:100%">
        <table class="table fieldlist table-nowrap" data-template="basictpl" id="free-programme-item-table" data-name="row[basic]">
            <tr class="table-bordered">
                <td class="text-center table-bordered" width="100">{:__('物料编码')}</td>
                <td class="text-center table-bordered" width="200">{:__('物料名称')}</td>
                <td class="text-center table-bordered" width="150">{:__('规格型号')}</td>
                <td class="text-center table-bordered" width="100">{:__('库区/货架')}</td>
                <td class="text-center table-bordered" width="100">{:__('数量')}</td>
                <td class="text-center table-bordered" width="40">{:__('操作')}</td>
            </tr>
        </table>
    </div>
    <textarea name="row[basic]" id="c-basic-textarea" class="form-control hidden" cols="30" rows="5">{$list_json}</textarea>
    <script id="basictpl" type="text/html">
        <tr class="table-bordered">
            <td class="text-center table-bordered">
                <%=value?value['number']:''%>
                <input type="hidden" name="<%=name%>[<%=index%>][cInvCode]" id="input_cInvCode_<%=index%>" class="form-control table-input " value="<%=value?value['number']:''%>"/></td>
            </td>
            <td class="text-center table-bordered"><%=value?value['name']:''%></td>
            <td class="text-center table-bordered"><%=value?value['specification']:''%></td>
            <td class="text-center table-bordered">
                <input class="c-shelves_id" style="display:none;" name="<%=name%>[<%=index%>][shelves_id]" type="text" value="<%=value?value['shelves_id']:''%>"/>
                <input type="text" name="<%=name%>[<%=index%>][shelves_name]" value="<%=value?value['shelves_name']:''%>" data-rule="required" class="form-control c-shelves_name"  readonly style="width: 160px;"/>
                <a href="javascript:;"   class="btn btn-success choose-shelves col-sm-offset"  onclick="selectshelves(this)" title="打开选择" >
                    <i class="fa fa-plus"></i> 选择
                </a>
            </td>
            <td class="text-center table-bordered">
                <input type=text  style="width:100px;"  name="<%=name%>[<%=index%>][iQuantity]"  value="<%=value?value['iQuantity']:''%>" class="form-control" data-rule="required"></td>
            </td>
            <td><span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span></td>
        </tr>
    </script>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8 {$row['check_status']==1?'hidden':''}">
            <button type="submit" class="btn btn-primary btn-embossed disabled ">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
